from wtforms import Form,StringField,IntegerField
from wtforms.validators import Email,Length,InputRequired

class RegistForm(Form):
    username = StringField(validators=[Length(1, 20, message='请输入正确格式的用户名!')])
    email = StringField(validators=[Email(message='邮箱格式错误'),InputRequired(message='请输入邮箱')])
    password1 = StringField(validators=[Length(1,20,message='请输入正确格式的密码!')])
    password2 = StringField(validators=[Length(1, 20, message='请输入正确格式的密码!')])
    tel = StringField(validators=[Length(1, 20, message='请输入正确格式的tel!')])

class LoginForm(Form):
    username = StringField(validators=[Length(1, 20, message='请输入正确格式的用户名!')])
    password = StringField(validators=[Length(1, 20, message='请输入正确格式的密码!')])

class AddinForm(Form):
    height = StringField(validators=[Length(1, 20, message='身高错误!')])
    weight = StringField(validators=[Length(1, 20, message='体重错误!')])
    age = StringField(validators=[Length(1, 20, message='请输入正确格式的age!')])

